package com.platform.user.controller;

import com.platform.bean.Result;
import com.platform.user.service.UserReportService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.Map;

@RestController
@RequestMapping("/userReport")
public class UserReportController {

    @Resource
    private UserReportService userReportService;

    @PostMapping("addUserReport")
    public Result<Map<String, Object>> addUserReport(@RequestBody Map<String, Object> params) throws IOException {
        return Result.ok(userReportService.addUserReport(params));
    }

    @PostMapping("queryUserIfReportedByWhistleblowerUserId")
    public Result<Map<String, Object>> queryUserIfReportedByWhistleblowerUserId(@RequestBody Map<String, Object> params) throws IOException {
        return Result.ok(userReportService.queryUserIfReportedByWhistleblowerUserId(params));
    }
}
